package entity

import "github.com/lab-online/internal/shared/valueobject"

func (c *Class) ApplyStudentPatch(patches ...valueobject.PatchVO) {
	for _, patch := range patches {
		patchStudents := patch.GetValue().([]string)
		switch {
		case patch.IsAdd():
			AddStudents(patchStudents...)(c)
		case patch.IsRemove():
			RemoveStudents(patchStudents...)(c)
		default:
			WithStudents(patchStudents...)(c)
		}
	}
}
